import React, {
    PureComponent
} from 'react';

import radio_un from './img/radio_un.png';
import radio_selected from './img/radio_selected.png';

import Press from './../Press';

interface Props {
    checked: boolean,
    onChange:Function,
    value:any
}

class Radio extends PureComponent<Props> {
    static defaultProps = {
        value:``,
        checked: false,
        onChange: () => null
    }

    render() {
        const {
            value,
            checked,
            onChange
        } = this.props;

        return (
            <Press
                value={value}
                onPress={onChange}
                source={checked ? radio_selected : radio_un}
            />
        )
    }
}

export default Radio;

